Handle EOF on xenstored socket.
authorSteven Hand <steven@xensource.com>
Fri, 27 Apr 2007 15:17:44 +0000 (16:17 +0100)
committerSteven Hand <steven@xensource.com>
Fri, 27 Apr 2007 15:17:44 +0000 (16:17 +0100)
Suggested by Pavel Kankovsky <peak@argo.troja.mff.cuni.cz>.

Signed-off-by: Steven Hand <steven@xensource.com>
tools/xenstore/xenstored_core.c

index d1288842217ac0a03c80ed0f49b027bd1798291f..0a800c7fe3fba1e1e3a11f1f2027ca084d90cdf3 100644 (file)
@@ -1336,7 +1336,7 @@ static void handle_input(struct connection *conn)
 
        bytes = conn->read(conn, in->buffer + in->used,
                           in->hdr.msg.len - in->used);
-       if (bytes < 0)
+       if (bytes <= 0)
                goto bad_client;
 
        in->used += bytes;